Skip to content

Introduce VortexError::Other and simplify Display implementation#6410

Merged
AdamGS merged 6 commits intodevelopfrom
adamg/trim-backtraces
Feb 17, 2026
Merged

Introduce VortexError::Other and simplify Display implementation#6410
AdamGS merged 6 commits intodevelopfrom
adamg/trim-backtraces

Conversation

@AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Feb 10, 2026

Does this PR closes an open issue or discussion?

This is a long running low burning effort to improve errors.

What changes are included in this PR?

  1. Removes VortexError::Url, VortexError::SerdeJson and VortexError::Invalid state - they are all not used.
  2. Removes VortexError::try_from_slice - this is an invariant and we always panic, no reason to treat it as a useful error.
  3. When backtraces are disabled, we don't print them.
  4. Splits the Generic error variant into External and Other, where External is meant to wrap external errors, and Other is for any error that doesn't match an existing variant. Other is now also the default of vortex_err and vortex_bail. They are used widely and often have very different meaning, I think its better to convey vague intent than the wrong one.
  5. I've also split out the individual components of the error Display form to make it clearer what gets printed and how its constructed.

What is the rationale for this change?

Error display is a bit more compact when downstream users don't enable backtraces, and I believe this makes maintaining vortex-error a bit easier.

How is this change tested?

In addition to existing tests that verify the result type, I've added a few tests that

Are there any user-facing changes?

One less variant, and vortex_err and vortex_bail return a different type.

@AdamGS AdamGS requested a review from robert3005 February 10, 2026 19:16
@AdamGS AdamGS added the changelog/break A breaking API change label Feb 10, 2026
$crate::VortexError::Context($msg.into(), Box::new($err))
)
}};
(External: $err:expr) => {{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general - using macros is better than functions here as they don't frames

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

Merging this PR will not alter performance

✅ 1057 untouched benchmarks
⏩ 1346 skipped benchmarks1


Comparing adamg/trim-backtraces (822a5cc) with develop (3688998)

Open in CodSpeed

Footnotes

  1. 1346 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

InvalidState(..) => "Invalid state error: ",
Serde(..) => "Serde error: ",
NotImplemented(..) => "Not implemented error: ",
MismatchedTypes(..) => "Mismatched types error: ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge into Compute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which one/s?

@AdamGS AdamGS force-pushed the adamg/trim-backtraces branch from 283ba01 to 87e6d72 Compare February 17, 2026 10:42
l => vortex_bail!(InvalidSerde: "invalid decimal byte length: {l}"),
2 => DecimalValue::I16(i16::from_le_bytes(
bytes
.try_into()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly, I think there are a few variants of VortexError we can get rid of, I'll do that in a followup PR because it might be a bigger change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #6554

@AdamGS AdamGS requested a review from gatesn February 17, 2026 12:05
@AdamGS AdamGS mentioned this pull request Feb 17, 2026
@robert3005
Copy link
Contributor

robert3005 commented Feb 17, 2026

any idea why vortex-error::fmt test_basic_display would panic? Ah backtrace should include test function

Copy link
Contributor

@robert3005 robert3005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this after Windows test pass, wouldn't want them failing for silly reasons

@AdamGS
Copy link
Contributor Author

AdamGS commented Feb 17, 2026

going to try and debug it for a bit, if I can't figure it out and it just some weird windows thing, I'll #[cfg] that check away.

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
@AdamGS AdamGS force-pushed the adamg/trim-backtraces branch from 240a374 to 822a5cc Compare February 17, 2026 13:59
@AdamGS AdamGS enabled auto-merge (squash) February 17, 2026 14:00
@AdamGS AdamGS disabled auto-merge February 17, 2026 14:05
@AdamGS AdamGS merged commit 2591586 into develop Feb 17, 2026
85 of 86 checks passed
@AdamGS AdamGS deleted the adamg/trim-backtraces branch February 17, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments